﻿<Page x:Class="WpfEffect.PageOuterGlowBitmapEffect"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="800"
	Title="PageOuterGlowBitmapEffect">
    <Canvas >
        <TextBlock Canvas.Left="19" Canvas.Top="74" Height="21" Name="tbnoise" Text="Noise" Width="70" />
        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" 
                Canvas.Left="99" Canvas.Top="74" Height="22" LargeChange="0.1" 
                Maximum="1" Minimum="0" Name="sldNoise1"  
                Value="{Binding ElementName=effect,Path=Noise}"
                Width="312" />

        <TextBlock Canvas.Left="19" Canvas.Top="21" Height="21" Name="tbOpacity2" Text="Opacity" Width="70" />
        <Slider AutoToolTipPlacement="BottomRight" AutoToolTipPrecision="1" Canvas.Left="99" 
                            Canvas.Top="21"    Value="{Binding ElementName=effect,Path=Opacity}"
                Height="22"   LargeChange="0.1" Maximum="1" Minimum="0" Name="sldOpacity1" Width="312" />

        <Label Canvas.Left="19" Canvas.Top="124" Height="28" Name="lblColor" Width="392" 
                            Padding="50,5,0,0" Background="Black" Foreground="Red"
                           BorderBrush="Black" BorderThickness="1" >选择颜色</Label>

        <TextBlock Canvas.Left="19" Canvas.Top="47" Height="21" Name="tbOuterGlowSize" Text="GlowSize" Width="70" />
        <Slider Canvas.Left="99" Canvas.Top="47" Height="22"  Width="312"  Minimum="0" Maximum="100"  AutoToolTipPlacement="BottomRight"    
                Value="{Binding ElementName=effect,Path=GlowSize}"
                AutoToolTipPrecision="1" x:Name="sldOuterGlowSize" Interval="1"  LargeChange="1"/>
        <Image Canvas.Left="502" Canvas.Top="13" Height="150" Name="image2" Source="images/1.png" Stretch="Fill" Width="160">
            <Image.BitmapEffect>
                <OuterGlowBitmapEffect x:Name="effect"  Noise="0"  GlowColor="Black" GlowSize="10" Opacity=".8"/>
            </Image.BitmapEffect>
        </Image>
        <TextBlock Canvas.Left="514" Canvas.Top="197" FontSize="25" Height="47" Name="textBlock2" Text="测试字" Width="181">
            <TextBlock.BitmapEffect>
                <OuterGlowBitmapEffect x:Name="effect2" 
                                        GlowColor="{Binding ElementName=effect, Path=GlowColor, Mode=OneWay}"
                                        GlowSize="{Binding ElementName=effect, Path=GlowSize, Mode=OneWay}" 
                                        Noise="{Binding ElementName=effect, Path=Noise, Mode=OneWay}" 
                                        Opacity="{Binding ElementName=effect, Path=Opacity, Mode=OneWay}" 
                                     />
            </TextBlock.BitmapEffect>
        </TextBlock>
        <TextBox Canvas.Left="19" Canvas.Top="189" Height="78" Name="textBox1" TextWrapping="Wrap" Width="398" />
    </Canvas>
</Page>
